home *** CD-ROM | disk | FTP | other *** search
- Path: reg.triumf.ca!bennett
- From: bennett@reg.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c++,comp.lang.c
- Subject: Re: Increasing stack size - HELP!
- Date: 21 Feb 1996 08:02 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <21FEB199608020960@reg.triumf.ca>
- References: <4gcd0h$8rf@izar.brunel.ac.uk>
- NNTP-Posting-Host: reg.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <4gcd0h$8rf@izar.brunel.ac.uk>, Francesco Fantauzzi <mapgfgf@brunel.ac.uk> writes...
- >Hi All!
- >
- >I'm using Borland C++ 4.0. I'm stuck 'cause, when I run my program, it
- >stops with a run-time error: "STACK OVERFLOW!".
- >
- >I checked the stack size (with stackavail()) and it's actually too small.
- >How can I tell the compiler that I would like a larger stack, overriding
- >the default size? I'm sure there's a way: I did it years ago, but have
- >forgotten it.
-
- Look in the documentation for "_stklen"
-
- I think you need to do:
- #include <dos.h>
- extern unsigned _stklen = 4096;
-
- If you are running out of stack because you are using large automatic arrays,
- you might make them global or static instead - this will get them off the
- stack.
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
-
-